#pragma once
#include "Term.h"

// AbstractTypeTerm command target

class AbstractTypeTerm : public Term
{
		
protected:
		TokenPair VarBody;

public:
		const AtomicType& getVar()		const			{return _ATOMICTYPE(VarBody.getLeft());};
		Term::const_reference getBody()	const		{return _TERM(VarBody.getRight());};

public:
	bool isAbstractTypeTerm() const{return true;};
	AbstractTypeTerm(const Term&, const AtomicType&,const string& ="");
	AbstractTypeTerm(const AbstractTypeTerm&);
	virtual ~AbstractTypeTerm();

public:
	const Term& operator=(const Term& T);
	string typeToString()const{return m_Type->toString();}; 
	virtual inline bool isConvertable(const Type& Argument) {return true;};
  
public:
//Pure Abstract
		Token::pointer normalized() const;
		Token::pointer applyArgument(Token::const_reference)  const;
		Token::pointer clone() const;
		bool isReducible() const;	   
		string toString() const;
		string view() const;
		bool operator==(Token::const_reference To) const;
		Token::pointer replaceAll(Token::const_reference, Token::const_reference) const;
		COUNTER complexity() const {return getVar().complexity()+getBody().complexity()+Term::complexity();};
		
public:
		bool TypeOccursinFreeVariable(Type::const_reference) const;
		
};


